home *** CD-ROM | disk | FTP | other *** search
- class mat
- {
- // internal representation of a C matrix:
- double** A; // pointer to allocated space for the matrix entries
- int m,n; // A is an mxn matrix
-
- public:
- mat ();
- mat (int m, int n);
- BooLean redim (int m, int m);
- void size (int& m, int& n);
- double& operator () (int i, int j);
- void print ();
- };
-
- inline double& mat:: operator () (int i, int j)
- {
- #ifdef ARRAY_RANGECHECK
- if (i<1 || i>m || j<1 || j>n)
- printf("Index (%d,%d) is out of bounds (1:%d,1:%d)\n",i,j,m,n);
- #endif
- return A[i][j];
- }
-